﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SpGetter
{
    public class Procedure
    {
        private string _name;
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private string _content;
        public string Content
        {
            get { return GetSPContentStringTrimSort(_content); }
            set { _content = value; }
        }

        private string GetSPContentStringTrimSort(string content)
        {
            string[] splitted = content.Split(new char[] { ' ', '\n' }, StringSplitOptions.RemoveEmptyEntries);

            string ret = string.Empty;
            for (int i = 0; i < splitted.Length; i++)
            {
                if (splitted[i].Trim() != string.Empty)
                    ret += i != splitted.Length - 1 ? splitted[i].Trim() + " " : splitted[i].Trim();
            }
            return ret;
        }

        //public List<ProcedureParam> GetParamList()
        //{
            
        //}

    }
}
